package io.jee.medusa.vo;

import java.io.Serializable;

public class ResultBean<T> implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private boolean success = true;
	private String message;
	private T data;

	public static <T> ResultBean<T> result(boolean success) {
		ResultBean<T> resultBean = new ResultBean<T>();
		resultBean.setSuccess(success);
		return resultBean;
	}

	public static <T> ResultBean<T> result(boolean success, String message) {
		ResultBean<T> resultBean = new ResultBean<T>();
		resultBean.setSuccess(success);
		resultBean.setMessage(message);
		return resultBean;
	}

	public static <T> ResultBean<T> result(boolean success, String message,
			T data) {
		ResultBean<T> resultBean = new ResultBean<T>();
		resultBean.setSuccess(success);
		resultBean.setMessage(message);
		resultBean.setData(data);
		return resultBean;
	}

	public boolean isSuccess() {
		return success;
	}

	public boolean success() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

}
